package com.ag.improvedjava.utils.comparators;

import java.util.Comparator;

public final class ReverseComparator<T> implements Comparator<T> {
	
    private final Comparator<T> forwardComparer;
    
	public ReverseComparator(Comparator<T> forwardComparer) {
		this.forwardComparer = forwardComparer;
	}

	@Override
	public int compare(T x, T y) {
		return forwardComparer.compare(y, x);
	}
}